#include <iostream>
#include <string>
#include <srchilite/sourcehighlight.h>
#include <srchilite/langmap.h>

#define DATADIR  "/usr/local/share/source-highlight/"

int
main(int argc, char *argv[])
{
   srchilite::SourceHighlight shl("esc.outlang");
   shl.setDataDir(DATADIR);
   std::string inputlang = "cpp.lang";

   if (argc > 1) {
      srchilite::LangMap langmap(DATADIR, "lang.map");
      std::string lang = langmap.getMappedFileNameFromFileName(argv[1]);
      if (lang != "") {
         inputlang = lang;
      }

      shl.highlight(argv[1], argv[2], inputlang);
   }
   else {
      shl.highlight("", "", inputlang);
   }

   return 0;
}
